﻿using System;
using System.Collections.Generic;
using System.Text;
using CharacterTrailLibrary.Factory;
using CharacterTrailLibrary.Model;
using CharacterTrailLibrary.Persist.BLL.Model;

namespace CharacterTrailLibrary.StaticData
{
    public class StaticObjects
    {
        public static void RefreshStaticObjects()
        {
            try
            {
                _lmbcprintlogModel = InstanceFactory.GetStaticDataQuerier().GetlmbcprintlogModels(" 1=1");
                _empModels = InstanceFactory.GetStaticDataQuerier().GetEmpModels(" 1=1");
                _iCItemModels = InstanceFactory.GetStaticDataQuerier().GetVIcItemQueryModels(" 1=1");
                _organizationModels = InstanceFactory.GetStaticDataQuerier().GetOrganizationModels(" 1=1");
                _supplierModels = InstanceFactory.GetStaticDataQuerier().GetSupplierModes(" 1=1");

                //_processList = InstanceFactory.GetStaticDataQuerier().GetProcessList();

                _procedureModelList = InstanceFactory.GetStaticDataQuerier().GetProcedureModelList();
            }
// ReSharper disable EmptyGeneralCatchClause
            catch{}
// ReSharper restore EmptyGeneralCatchClause
          
        }


        private static List<lmbcprintlogModel> _lmbcprintlogModel = null;
        public static List<lmbcprintlogModel> GetlmbcprintlogModels()
        {
            return _lmbcprintlogModel ??
                   (_lmbcprintlogModel = InstanceFactory.GetStaticDataQuerier().GetlmbcprintlogModels(" 1=1"));
        }

        private static List<tEmpModel> _empModels = null;
        public static List<tEmpModel> GetEmpModels()
        {
            return _empModels ??
                   (_empModels = InstanceFactory.GetStaticDataQuerier().GetEmpModels(" 1=1"));
        }

        private static List<VIcItemQueryModel> _iCItemModels = null;
        public static List<VIcItemQueryModel> GetICItemModels()
        {
            return _iCItemModels ??
                   (_iCItemModels = InstanceFactory.GetStaticDataQuerier().GetVIcItemQueryModels(" 1=1"));
        }

        private static List<Process> _processList = null;
        public static List<Process> GetProcessList()
        {
            return _processList ??
                   (_processList = InstanceFactory.GetStaticDataQuerier().GetProcessList());
        }

        private static List<TProcedureModel> _procedureModelList = null;
        public static List<TProcedureModel> GetProcedureModelList()
        {
            return _procedureModelList ??
                   (_procedureModelList = InstanceFactory.GetStaticDataQuerier().GetProcedureModelList());
        }


        private static List<tOrganizationModel> _organizationModels = null;
        public static List<tOrganizationModel> GetOrganizationModels()
        {
            return _organizationModels ??
                   (_organizationModels = InstanceFactory.GetStaticDataQuerier().GetOrganizationModels(" 1=1"));
        }

        private static List<tSupplierModel> _supplierModels = null;
        public static List<tSupplierModel> GetSupplierModels()
        {
            return _supplierModels ??
                   (_supplierModels = InstanceFactory.GetStaticDataQuerier().GetSupplierModes(" 1=1"));
        }
    }
}
